{
  "properties" : { },
  "id" : "08d19d07679c4f2f834e35936324f16f",
  "script" : null,
  "groupId" : "832da851b4034ccdb63b69855a4390ac",
  "name" : "查询属性列表",
  "createTime" : 1727070867491,
  "updateTime" : 1726625398603,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "list",
  "method" : "GET",
  "parameters" : [ {
    "name" : "name",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }, {
    "name" : "fromField",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }, {
    "name" : "modelId",
    "value" : "1656580857297674241",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": {\n        \"total\": 1,\n        \"current\": 1,\n        \"size\": 30,\n        \"records\": [\n            {\n                \"id\": \"1656562842510352386\",\n                \"name\": \"内存使用率\",\n                \"fromField\": \"\",\n                \"fromTable\": \"memUsage\",\n                \"fromDb\": \"2\",\n                \"count\": \"1\",\n                \"dateFormatter\": \"\",\n                \"width\": \"33%\",\n                \"minWidth\": \"\",\n                \"sort\": \"16\",\n                \"englishName\": \"\",\n                \"sqlStatement\": \"\",\n                \"rowId\": \"1\"\n            }\n        ]\n    }\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }
}
================================
import org.apache.commons.lang3.StringUtils

if (!StringUtils.isEmpty(modelId)) {
    sql = """
         SELECT * FROM ndmp_dynamic_model_attribute  where id in (
  select column_id from NDMP_DYNAMIC_MODEL_RELATION  where model_id=#{modelId}
 )
        """
} else {
    sql = """

    SELECT * FROM ndmp_dynamic_model_attribute where 1=1
    <if test="id != null ">
        AND id = #{id}
    </if>
    <if test="name != null and name != ''">
        AND name like concat('%',#{name},'%')
    </if>
    <if test="englishName != null and englishName != ''">
        AND english_name like concat('%',#{englishName},'%')
    </if>
    <if test="fromField != null and fromField != ''">
        AND from_field like concat('%',#{fromField},'%')
    </if>
    <if test="fromTable != null and fromTable != ''">   
        AND from_table like concat('%',#{fromTable},'%')
    </if>
    <if test="fromDb != null and fromDb != ''">
        AND from_db like concat('%',#{fromDb},'%')
    </if>
    <if test="count != null ">
        AND count = #{count}
    </if>
    <if test="dateFormatter != null and dateFormatter != ''">
        AND date_formatter like concat('%',#{dateFormatter},'%')
    </if>
    <if test="width != null and width != ''">
        AND width like concat('%',#{width},'%')
    </if>
    <if test="minWidth != null and minWidth != ''">
        AND min_width like concat('%',#{minWidth},'%')
    </if>
    <if test="sqlStatement != null and sqlStatement != '' ">
        AND sql_statement = #{sqlStatement}
    </if>

"""
}


return db.page(sql)